$OpenBSD: patch-ext_ffmpeg_gstffmpegcodecmap_c,v 1.7 2013/03/27 11:41:11 brad Exp $

From upstream:
- Channel layouts are now set for DTS and (E)AC3 by libav.
- Add mapping for Indeo 4 video codec.
- Add support for 10-bit YUV color formats.
- Add decode support for prores.

--- ext/ffmpeg/gstffmpegcodecmap.c.orig	Mon Oct 31 06:14:03 2011
+++ ext/ffmpeg/gstffmpegcodecmap.c	Mon Mar 25 22:41:45 2013
@@ -340,25 +340,6 @@ gst_ff_aud_caps_new (AVCodecContext * context, enum Co
     GstAudioChannelPosition *pos;
     guint64 channel_layout = context->channel_layout;
 
-    if (channel_layout == 0) {
-      const guint64 default_channel_set[] = {
-        0, 0, CH_LAYOUT_SURROUND, CH_LAYOUT_QUAD, CH_LAYOUT_5POINT0,
-        CH_LAYOUT_5POINT1, 0, CH_LAYOUT_7POINT1
-      };
-
-      switch (codec_id) {
-        case CODEC_ID_EAC3:
-        case CODEC_ID_AC3:
-        case CODEC_ID_DTS:
-          if (context->channels > 0
-              && context->channels < G_N_ELEMENTS (default_channel_set))
-            channel_layout = default_channel_set[context->channels - 1];
-          break;
-        default:
-          break;
-      }
-    }
-
     caps = gst_caps_new_simple (mimetype,
         "rate", G_TYPE_INT, context->sample_rate,
         "channels", G_TYPE_INT, context->channels, NULL);
@@ -925,6 +906,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
           "indeoversion", G_TYPE_INT, 5, NULL);
       break;
 
+    case CODEC_ID_INDEO4:
+      caps = gst_ff_vid_caps_new (context, codec_id, "video/x-indeo",
+          "indeoversion", G_TYPE_INT, 4, NULL);
+      break;
+
     case CODEC_ID_INDEO3:
       caps = gst_ff_vid_caps_new (context, codec_id, "video/x-indeo",
           "indeoversion", G_TYPE_INT, 3, NULL);
@@ -1214,6 +1200,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
       caps = gst_ff_vid_caps_new (context, codec_id, "video/x-dnxhd", NULL);
       break;
 
+    case CODEC_ID_PRORES:
+      caps =
+          gst_ff_vid_caps_new (context, codec_id, encode, "video/x-prores",
+          NULL);
+
     case CODEC_ID_MIMIC:
       caps = gst_ff_vid_caps_new (context, codec_id, "video/x-mimic", NULL);
       break;
@@ -1775,6 +1766,24 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, A
     case PIX_FMT_YUV411P:
       fmt = GST_MAKE_FOURCC ('Y', '4', '1', 'B');
       break;
+    case PIX_FMT_YUV420P10BE:
+      fmt = GST_MAKE_FOURCC ('D', '4', '2', '0');
+      break;
+    case PIX_FMT_YUV420P10LE:
+      fmt = GST_MAKE_FOURCC ('d', '4', '2', '0');
+      break;
+    case PIX_FMT_YUV422P10BE:
+      fmt = GST_MAKE_FOURCC ('D', '4', '2', '2');
+      break;
+    case PIX_FMT_YUV422P10LE:
+      fmt = GST_MAKE_FOURCC ('d', '4', '2', '2');
+      break;
+    case PIX_FMT_YUV444P10BE:
+      fmt = GST_MAKE_FOURCC ('D', '4', '4', '4');
+      break;
+    case PIX_FMT_YUV444P10LE:
+      fmt = GST_MAKE_FOURCC ('d', '4', '4', '4');
+      break;
     case PIX_FMT_RGB565:
       bpp = depth = 16;
       endianness = G_BYTE_ORDER;
@@ -2146,11 +2155,27 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
         case GST_MAKE_FOURCC ('Y', 'U', 'V', '9'):
           context->pix_fmt = PIX_FMT_YUV410P;
           break;
-#if 0
-        case FIXME:
+        case GST_MAKE_FOURCC ('Y', '4', '4', '4'):
           context->pix_fmt = PIX_FMT_YUV444P;
           break;
-#endif
+        case GST_MAKE_FOURCC ('D', '4', '2', '0'):
+          context->pix_fmt = PIX_FMT_YUV420P10BE;
+          break;
+        case GST_MAKE_FOURCC ('d', '4', '2', '0'):
+          context->pix_fmt = PIX_FMT_YUV420P10LE;
+          break;
+        case GST_MAKE_FOURCC ('D', '4', '2', '2'):
+          context->pix_fmt = PIX_FMT_YUV422P10BE;
+          break;
+        case GST_MAKE_FOURCC ('d', '4', '2', '2'):
+          context->pix_fmt = PIX_FMT_YUV422P10BE;
+          break;
+        case GST_MAKE_FOURCC ('D', '4', '4', '4'):
+          context->pix_fmt = PIX_FMT_YUV444P10BE;
+          break;
+        case GST_MAKE_FOURCC ('d', '4', '4', '4'):
+          context->pix_fmt = PIX_FMT_YUV444P10BE;
+          break;
       }
     }
   } else if (strcmp (gst_structure_get_name (structure),
@@ -3180,6 +3205,9 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCo
       switch (indeoversion) {
         case 5:
           id = CODEC_ID_INDEO5;
+          break;
+        case 4:
+          id = CODEC_ID_INDEO4;
           break;
         case 3:
           id = CODEC_ID_INDEO3;
